package adv_pre;

import java.util.*;

public class ArrayTest3 {

	public static void main(String[] args) {
		// 新闻类
		List list = new ArrayList(20);
		for (int i = 0; i < 10; i++) {
			list.add(new News(i + 1, "双十" + (i + 1) + "我一毛都没有买！", "xxx",
					"2018-11-12"));
		}
		System.out.println(list.size());
		System.out.println(list);
		System.out.println("找新闻的位置：");
		News n1 = new News(-1, "双十2我一毛都没有买！", null, null);
		boolean in = list.contains(n1);
		System.out.println("包含这个新闻？" + n1);
		System.out.println(in);
		System.out.println(News.count);
		int pos = list.indexOf(n1);
		System.out.println("位置在" + pos);
		System.out.println("删除这个n1........");
	}

}
